import fetch from 'node-fetch';

async function checkCategories() {
    console.log('📋 查看当前所有分类\n');
    
    const baseUrl = 'http://localhost:8000/api/v1/admin';
    const authToken = 'Bearer admin_token';
    
    try {
        const response = await fetch(`${baseUrl}/category/list`, {
            method: 'GET',
            headers: {
                'Authorization': authToken
            }
        });
        const result = await response.json();
        
        if (result.code === 200) {
            console.log('📊 所有分类:');
            result.data.forEach(category => {
                console.log(`ID: ${category.id}, 名称: ${category.name}, 别名: ${category.slug}`);
            });
        } else {
            console.log('获取分类失败:', result);
        }
        
    } catch (error) {
        console.error('请求失败:', error.message);
    }
}

checkCategories();
